﻿package Message.Public
{
    import Framework.MQ.*;
    import Framework.Serialize.*;

    public class SBroadcast extends IMessageBase
    {
        public var area:int;
        public var type:int;
        public var code:int;
        public var miniPlayers:Array;
        public var minLevel:int;
        public var msgKey:String;
        public var params:Array;
        public var content:String;
        public var priority:Boolean;
        public const _type:int = 101;
        public static var _regist:SBroadcast = new SBroadcast(true);

        public function SBroadcast(param1:Boolean = false)
        {
            if (param1)
            {
                MessageManager.instance().regist(this);
            }
            return;
        }// end function

        override public function getType() : int
        {
            return this._type;
        }// end function

        override public function clone() : IMessageBase
        {
            return new SBroadcast();
        }// end function

        override public function __write(param1:SerializeStream) : void
        {
            param1.writeInt(this.area);
            param1.writeByte(this.type);
            param1.writeInt(this.code);
            SeqMiniPlayerHelper.write(param1, this.miniPlayers);
            param1.writeByte(this.minLevel);
            param1.writeString(this.msgKey);
            SeqStringHelper.write(param1, this.params);
            param1.writeString(this.content);
            param1.writeBool(this.priority);
            return;
        }// end function

        override public function __read(param1:SerializeStream) : void
        {
            this.area = param1.readInt();
            this.type = param1.readByte();
            this.code = param1.readInt();
            this.miniPlayers = SeqMiniPlayerHelper.read(param1);
            this.minLevel = param1.readByte();
            this.msgKey = param1.readString();
            this.params = SeqStringHelper.read(param1);
            this.content = param1.readString();
            this.priority = param1.readBool();
            return;
        }// end function

    }
}
